
<template>
    <div id="AdminModule">
        <el-container>
            <!-- 左侧导航 -->
             <NavMenu />
             <el-container>
                <!-- 右侧头部 -->
                <el-header>
                    <p>{{ $route.meta.title }}</p>
                </el-header>
                <!-- 右侧主体 -->
                 <el-main>
                    <router-view />
                 </el-main>
             </el-container>
             
        </el-container>
    </div>
</template>

<script setup >
import NavMenu from './navMenu.vue'
</script>

<style scoped>
/* 全局样式重置与基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#AdminModule {
  width: 100vw;
  height: 100vh;
  background-color: #f5f7fa;
  overflow: hidden;
}

/* Element容器布局优化 */
.el-container {
  height: 100%;
}

/* 左侧导航栏样式 */
.nav-menu-container {
  width: 240px;
  height: 100%;
  background-color: #2c3e50;
  transition: width 0.3s ease;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* 导航栏折叠效果（可配合交互实现） */
.nav-menu-container.collapsed {
  width: 64px;
}

/* 右侧头部区域 */
.el-header {
  height: 60px !important; /* 覆盖Element默认样式 */
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 5;
}

.el-header p {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin: 0;
}



/* 主内容区域 */
.el-main {
  padding: 20px;
  overflow-y: auto;
  height: calc(100% - 60px); /* 减去头部高度 */
}

/* 路由视图容器 */
router-view {
  width: 100%;
  min-height: 100%;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav-menu-container {
    position: fixed;
    left: -240px;
  }
  
  .nav-menu-container.show {
    left: 0;
  }
  
  .el-container {
    padding-left: 0;
  }
  
  .el-main {
    padding: 15px;
  }
  
  router-view {
    padding: 15px;
  }
}

/* 滚动条美化 */
.el-main::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.el-main::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.el-main::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.el-main::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
</style>